package innersort;

public class BaseSort {

    public static void exchange(int[] array, int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }

    protected static void print(int[] array, int temp, Integer i, Integer j) {
        System.out.print(temp + " : ");
        print(array, i, j);
    }

    protected static void print(int[] array) {
        print(array, null, null);
    }

    protected static void print(int[] array, Integer m, Integer n) {
        for (Integer i = 0; i < array.length; i++) {
            if (i.equals(m)) {
                System.out.print(" [");
            }
            if (i.equals(n)) {
                System.out.print(" {");
            }
            if (!i.equals(n) && !i.equals(m)) {
                System.out.print(" ");
            }

            System.out.print(array[i]);

            if (i.equals(n)) {
                System.out.print("} ");
            }
            if (i.equals(m)) {
                System.out.print("] ");
            }
            if (!i.equals(n) && !i.equals(m)) {
                System.out.print(" ");
            }
        }
        System.out.println("");
    }
}
